package top.abrsm.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.util.Date;

@TableName ("message_info")
public class MessageEntity extends BaseEntity {

    @TableId (type = IdType.INPUT, value = "id")
    private String id;
    @TableField ("postsId")
    private String postsId;
    @TableField(exist = false)
    private String postsTitle;
    @TableField ("stuId")
    private String stuId; // 发起评论或点赞的用户Id，用于在消息中心显示头像
    @TableField(exist = false)
    private String avatarUrl;
    @TableField(exist = false)
    private String nickName;
    @TableField ("notifierId")
    private String notifierId; // 被通知人的Id，登录用户根据此字段查询是否有自己的站内信消息
    @TableField ("message")
    private String message;
    @TableField ("type")
    private Integer type;
    @TableField("isRead")
    private Integer isRead;
    @TableField ("createTime")
    private Date createTime;
    @TableField ("changeTime")
    private Date changeTime;
    @TableField ("isUsed")
    private Integer isUsed;

    public MessageEntity () {
    }

    public MessageEntity (String id, String stuId, String message, Integer type) {
        this.id = id;
        this.stuId = stuId;
        this.message = message;
        this.type = type;
    }

    public MessageEntity (String id, String postsId, String stuId, String notifierId, String message, Integer type) {
        this.id = id;
        this.postsId = postsId;
        this.stuId = stuId;
        this.notifierId = notifierId;
        this.message = message;
        this.type = type;
    }

    public String getId () {
        return id;
    }

    public void setId (String id) {
        this.id = id;
    }

    public String getPostsId () {
        return postsId;
    }

    public void setPostsId (String postsId) {
        this.postsId = postsId;
    }

    public String getPostsTitle () {
        return postsTitle;
    }

    public void setPostsTitle (String postsTitle) {
        this.postsTitle = postsTitle;
    }

    public String getStuId () {
        return stuId;
    }

    public void setStuId (String stuId) {
        this.stuId = stuId;
    }

    public String getAvatarUrl () {
        return avatarUrl;
    }

    public void setAvatarUrl (String avatarUrl) {
        this.avatarUrl = avatarUrl;
    }

    public String getNickName () {
        return nickName;
    }

    public void setNickName (String nickName) {
        this.nickName = nickName;
    }

    public String getNotifierId () {
        return notifierId;
    }

    public void setNotifierId (String notifierId) {
        this.notifierId = notifierId;
    }

    public String getMessage () {
        return message;
    }

    public void setMessage (String message) {
        this.message = message;
    }

    public Integer getType () {
        return type;
    }

    public void setType (Integer type) {
        this.type = type;
    }

    public Integer getIsRead () {
        return isRead;
    }

    public void setIsRead ( Integer isRead ) {
        this.isRead = isRead;
    }

    public Date getCreateTime () {
        return createTime;
    }

    public void setCreateTime (Date createTime) {
        this.createTime = createTime;
    }

    public Date getChangeTime () {
        return changeTime;
    }

    public void setChangeTime (Date changeTime) {
        this.changeTime = changeTime;
    }

    public Integer getIsUsed () {
        return isUsed;
    }

    public void setIsUsed (Integer isUsed) {
        this.isUsed = isUsed;
    }
}
